package router

import (
	"github.com/gin-gonic/gin"
	"prod-mgmt/handlers"
)

func Init() *gin.Engine {
	// 1.创建路由
	r := gin.Default()
	// 2.绑定路由规则，执行的函数
	// gin.Context，封装了request和response
	r.POST("/login", handlers.Login)
	r.GET("/list", handlers.List)
	r.POST("/goodsAdd", handlers.GoodAdd)
	return r
}
